I am having a hard time working C++ into some real time applications using
X-windows and xview. The difficulty arises when I try to define a function
to call at certain intervals. The procedure to set this function is
notify_set_itimer_func. The problem is that I can not seem to prototype
the notified function in such a way as to make the compiler happy. See
the error below.
"main.c", line 216: Error: Formal argument func of type notify_value(*)(...) in call to notify_set_itimer_func(unsigned long, notify_value(*)(...), int, itimerval*, itimerval*) is being passed notify_value(*)().
I have the notified function declared thusly:
Notify_value notified_function();
The notify.h file declares notify_set_itimer_func as:
This implies that the notified function should be of type Notify_func, not
Notify_value as the XView programming manager would lead one to believe.
A quick change to the prototype later :
Notify_value notified_function();
And on the recompile, I get :
"main.c", line 200: Error: Formal argument func of type notify_value(*)(...) in call to notify_set_itimer_func(unsigned long, notify_value(*)(...), int, itimerval*, itimerval*) is being passed notify_value(*)(...)(*)().
This makes me think that notified_function should be declared without the
parentheses. But that would conflict with the declaration of the function's
source code.
Notify_value is defined as a pointer to a function of type Notify_func. But
I can not for the life of me find where Notify_func is defined. I think I
might be able to solve the problem if I could find that.
Anyway, has anyone else encountered this problem, or better yet, overcome it?
I would be very grateful for any help you could offer.